{*
 * @author 		Zprofess <contact@zprofess.com>
 * @copyright  	2011 Zprofess
 * @version  	1.0 
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *}

{if $latestReviews|@count gt 0}
	<div id="latest_reviews_block_home" class="clear table_block">
		<table class="std" style="width: 100%">
			<thead><tr>
				<th class="first_item" style="width:160px;">{l s='Latest recieved customer reviews' mod='reviewratingsynthesis'}</th>
				<th class="item"></th>
			</tr></thead>
			<tbody>
			{foreach from=$latestReviews item=latestReview name=myLoop}
				<tr>
					<td>
						{if !{$only_review}}
							Rating: {$latestReview['rating']|string_format:"%.1f"}
							<div id="hook_raty_home_{$smarty.foreach.myLoop.iteration}" class="displayRatingZprofess_{$smarty.foreach.myLoop.iteration}"></div>
							<script type="text/javascript">
								$(".displayRatingZprofess_{$smarty.foreach.myLoop.iteration}").raty({									
									width: 			{$configRating['width']},
									cancel: 		{$configRating['cancel']},						
									cancelHint:   	"{$configRating['cancelHint']}",  
									cancelOff:  	"{$configRating['cancelOff']}",
									cancelOn:   	"{$configRating['cancelOn']}", 	
									cancelPlace:  	"{$configRating['cancelPlace']}", 
								
									half:  			true,
									space:       	false,
									hintList:		{$configRating['hintList']},
									noRatedMsg:		"{$configRating['noRatedMsg']}",
									number:     	{$configRating['number']},
									path:           "{$configRating['path']}",	
									starHalf:		"{$configRating['starHalf']}",
									starOff:		"{$configRating['starOff']}",
									starOn:			"{$configRating['starOn']}",
									readOnly:		true,
									start: 			{$latestReview['rating']},
								});
							</script>
						{/if}
						
						{$latestReview['date_add']} <br />
						Review by <b>{$latestReview['customer_name']|escape:'html':'UTF-8'}</b><br />
						{if $display_email == true}
							{$latestReview['email']|escape:'html':'UTF-8'}<br />
						{/if}
						{if $display_website == true}
							{$latestReview['website']|escape:'html':'UTF-8'}
						{/if}
					</td>
					<td>
						{if $display_title == true}
							<b>{$latestReview['title']}</b> <br />
						{/if}
						{$latestReview['content']|escape:'html':'UTF-8'|nl2br}
					</td>
				</tr>
			{/foreach}
			</tbody>
		</table>
	</div>
{/if}